<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<body>
    <script th:fragment="jquery" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script th:fragment="semantic" src="https://cdn.bootcdn.net/ajax/libs/semantic-ui/2.4.1/semantic.js"></script>
    <script th:fragment="mobile-hide">
        $(document).on('click', 'nav .button', function () {
            $(".tog").toggleClass("mobile-hide");
        });
    </script>
    <script th:fragment="dropdown">
        $(document).ready(
            function () {
                $('.ui.dropdown').dropdown();
                $('.multiple.dropdown').dropdown({
                    allowAdditions: true
                });
            }
        );
    </script>

    <th:block th:fragment="vue">
        <script src="https://cdn.bootcdn.net/ajax/libs/vue/3.1.5/vue.global.prod.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
        <script>
            function postJson(url, jsons, callback) {
                return axios.post(url, jsons, {
                    header: {
                        'Content-Type': 'application/json'
                    }
                }).then(response => {
                    var json = response.data;
                    if (json.code == 200) {
                        callback(json.result);
                    } else {
                        alert(json.message);
                    }
                }).catch(function (error) {
                    console.log(error);
                });
            }
            function getJson(url, callback) {
                return axios.get(url).then(response => {
                    var json = response.data;
                    if (json.code == 200) {
                        callback(json.result);
                    } else {
                        alert(json.message);
                    }
                }).catch(function (error) {
                    console.log(error);
                });
            }
        </script>
    </th:block>

</body>

</html>